package p.ithorns.sample.tracer.jaeger;

import ch.qos.logback.classic.pattern.ClassicConverter;
import ch.qos.logback.classic.spi.ILoggingEvent;

import java.util.Optional;

/**
 * TraceIdConverter
 * TODO
 *
 * @author HtL
 * @date 2025/3/21 14:54
 * @since 1.0.0
 */
public class TraceIdConverter extends ClassicConverter {

    @Override
    public String convert(ILoggingEvent event) {
        return Optional.ofNullable(TraceContext.get()).orElse("");
    }
}